<%@ page language="java" contentType="text/html; charset=utf-8"   pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0040)http://www.life-goal.com/prolist.asp?id= -->
<HTML><HEAD>
<title>产品列表</title>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<STYLE type=text/css>
BODY {
	BACKGROUND-POSITION: center center; 
	FONT-SIZE: x-small; 
	BACKGROUND-IMAGE: none; 
	SCROLLBAR-FACE-COLOR: #c0c0c0; 
	SCROLLBAR-HIGHLIGHT-COLOR: #c0c0c0; 
	SCROLLBAR-SHADOW-COLOR: #c0c0c0; 
	SCROLLBAR-3DLIGHT-COLOR: #e0e0e0; 
	SCROLLBAR-ARROW-COLOR: #333333; 
	SCROLLBAR-TRACK-COLOR: #e0e0e0; 
	SCROLLBAR-DARKSHADOW-COLOR: #c0c0c0;
	FONT-FAMILY: Arial, Helvetica, sans-serif; 
	overflow-y: scroll; 
}
A:link {
	FONT-SIZE: x-small; COLOR: #999999; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
A:visited {
	FONT-SIZE: x-small; COLOR: #999999; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
A:active {
	FONT-SIZE: x-small; COLOR: #ff0000; FONT-FAMILY: Arial, Helvetica, sans-serif
}
A:hover {
	FONT-SIZE: x-small; COLOR: #ff0000; FONT-FAMILY: Arial, Helvetica, sans-serif
}

TD {
	FONT-SIZE: small; COLOR: #000033; FONT-FAMILY: Arial, Helvetica, sans-serif
}
</STYLE>
<script type="text/javascript" language="javascript">
function showImg(idStr){
	window.parent.document.getElementById('mainId').src="product-img!input.do?id=" + idStr;
}
</script>
</HEAD>
<BODY leftMargin="0" topMargin="0" marginwidth="0" marginheight="0">
<table id="prolist1" width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
			<TABLE cellSpacing=2 cellPadding=0 width="100%" align="center">
			  <TBODY>
			  <!-- 控制表格，其中haveImg用来标记产品是否有图片 -->
			  <s:set name="tabNum" value="0"/>
			  <s:set name="haveImg" value="0"/>
			  
			  <!-- 控制javascript showImg(idStr) -->
			  <s:set name="funNum" value="1"/>
			  
			  <s:iterator value="productList">
				  <s:if test="%{(#tabNum%2 eq 0) && (#haveImg%2 eq 0)}">
				  	<TR valign="top">
				  </s:if>
				  <s:set name="haveImg" value="0"/>
				  	<!-- id -->
				    <s:set name="idStr" value="id"/>
				    
				    <!-- 控制产品图片的显示，每个产品显示一张图片 -->
				    <s:set name="imgNum" value="1"/>
				    <s:set id="nameStr" name="nameStr"><s:property value="name"/></s:set>
				    <s:set id="priceStr" name="priceStr"><s:property value="price"/></s:set>
				    <s:iterator value="imagesCollection">
				    <s:if test="%{#imgNum eq 1}">
				    	<s:set name="tabNum" value="%{#tabNum + 1}"/>
				    	<s:set name="haveImg" value="%{#haveImg + 1}"/>
					    <TD align=middle>
					      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
					        <TR>
					          <TD align=middle>
					          		<a href="#" onclick="showImg('<s:property value="%{#idStr}"/>')" title='<s:property value="%{nameStr}"/>(<s:property value="%{priceStr}"/>元/盒)'><IMG height="74" src="common/userfiles/image/<s:property value='renameAs'/>" alt='<s:property value="%{nameStr}"/>(<s:property value="%{priceStr}"/>元/盒)' width="108" border="1" style="border-color: #000033"></a>
					          		<s:if test="%{#funNum eq 1}">
						          		<script type="text/javascript" language="javascript">
						          			showImg('<s:property value="%{#idStr}"/>');
						          		</script>
						          		<s:set name="funNum" value="%{#funNum + 1}"/>
					          		</s:if>
					          </TD>
					        </TR>
					        <TR>
					          <TD align=middle>
					          	<a href="#" onclick="showImg('<s:property value="%{#idStr}"/>')">
					          		<s:property value="%{nameStr}"/>
					          		<br/>
					          		(<s:property value="%{priceStr}"/>元/盒)
					          	</a>
					          </TD>
					        </TR>
					      </TABLE>
					    </TD>
				    </s:if>
				    <s:set name="imgNum" value="%{#imgNum + 1}"/>	
				    </s:iterator>
				    <s:set name="haveImg" value="%{#haveImg + 1}"/>
				  <s:if test="%{((#tabNum - #haveImg)%2 eq 0) && (#haveImg%2 eq 0)}">
				  	</TR> 
				  </s:if>
			  </s:iterator> 
			  <s:if test="%{#tabNum%2 eq 1}">
			   		<td>
			   			&nbsp;
			   		</td>
			  	</TR> 
			  </s:if>
			  <!-- 如果没有产品 start -->
			  <s:if test="%{#tabNum eq 0}">
				  <TR valign="top">
				  		<TD align="middle">
					      <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
					        <TR>
					          <TD align="middle">
					          		<a href="#" onclick="return false;" title='找不到相关产品'><IMG height="74" src="imgs/no-img.jpg" alt='找不到相关产品' width="108" border="1" style="border-color: #000033"></a>
						          	<script type="text/javascript" language="javascript">
						          		showImg('0');
						          	</script>
					          </TD>
					        </TR>
					        <TR>
					          <TD align="center">
					          	<a href="#" onclick="return false;" title='找不到相关产品'>
					          		找不到相关产品
					          	</a>
					          </TD>
					        </TR>
					      </TABLE>
					    </TD>
				  </TR>
			  </s:if>
			  <!-- 如果没有产品 end -->
			 </TBODY>
			</TABLE>
		</td>
	</tr>
</table>
</BODY>
</HTML>
